import { createRouter,createWebHistory} from "vue-router";

// 路由信息
const routes = [
    {
        path: "/",
        name: "index",
        component:  () => import('../components/index.vue'),
    },
    {
        path: "/login",
        name: "login",
        component:  () => import('../components/login.vue'),
    },
    {
        path: "/register",
        name: "register",
        component:  () => import('../views/user/add.vue'),
    },
    {
        path: "/personnel",
        name: "personnel",
        component:  () => import('../components/personnel.vue'),
        children:[
            {
                path: "/users",
                name: "users",
                component:  () => import('../views/user/users.vue'),
            },
            {
                path: "/pindex",
                name: "pindex",
                component:  () => import('../views/personnel/pindex.vue'),
            },
            {
                path: "/class",
                name: "class",
                component:  () => import('../views/personnel/class.vue'),
            },
            {
                path: "/personnels",
                name: "personnels",
                component:  () => import('../views/personnel/personnels.vue'),
            },

        ]
    },


];

// 导出路由
const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;

